package demo;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class GetFileSizeToList {
    public static void main(String[] args) {
        File file = new File("D:\\workspacePractice\\practice\\src\\main\\java\\yuanwenjian");
        File[] files = file.listFiles();
        HashMap<String, List> map = new HashMap<>();
        ArrayList<String> listBig = new ArrayList<>();
        ArrayList<String> listSmall = new ArrayList<>();
        for (File file1 : files) {
            if (3000 < file1.length()){
                listBig.add(file1.getName());
            }else {
                listSmall.add(file1.getName());
            }
        }
        map.put("Big", listBig);
        map.put("Small", listSmall);
        System.out.println(map.get("Big"));
        System.out.println(map.get("Small"));
    }
}